const {ccclass, property} = cc._decorator;

@ccclass
export default class WaitingConnection extends cc.Component {

    @property(cc.Node)
    target: cc.Node = null;

    @property(cc.Label)
    lblContene: cc.Label = null;

    isShow = false;
    

    onLoad() {
        if(!cc.vv){
            return;
        }

        cc.vv.wc = this;
        this.node.active = this.isShow;
        
    }


    update(dt){
        this.node.rotation = this.target.rotation - dt * 45;
    }



    show(content?: string){
        this.isShow = true;
        if(this.node){
            this.node.active = this.isShow;
        }
        if(this.lblContene){
            if(content == null){
                content = '';
            }
            this.lblContene.string = content;
        }
    }

    hide(){
        this.isShow = false;
        if(this.node){
            this.node.active = this.isShow;
        }
    }
}
